from time import sleep

from selenium.webdriver.common.by import By

from base import Base


class Page(Base):
    sousuo=(By.ID,'com.xiachufang:id/ts_key_word')
    shuru='new UiSelector().resourceId("com.xiachufang:id/search_edit_text")'
    dianji=(By.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.LinearLayout/android.widget.LinearLayout/android.widget.RelativeLayout/android.widget.RelativeLayout[3]/android.widget.TextView')
    dy=(By.ID,'com.xiachufang:id/tv_load_status_major')
    def sousuoyewu(self,filename):
        self.ele_loc(self.sousuo).click()
        sleep(2)
        self.ele_ui_loc(self.shuru).send_keys(filename)
        sleep(2)
        self.ele_loc(self.dianji).click()
        sleep(2)
